﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MyFrameWork.Dam;
using System.Collections;
using System.Data;
using System.Data.Common;
using MvcApplication5.Models;

namespace MvcApplication5.DAM
{
    public class TestDAM : DataDAM
    {
        public TestDAM()
        {
            this.CreateDataBase("MAINDB");
        }

        public int InsertTestInfo()
        {
            #region InsertDate
            //Dictionary<string, object> tableColumn = new Dictionary<string, object>();
            //tableColumn.Add("CollegeID", 9);
            //tableColumn.Add("Name", "环境保护");

            //this.InsertData("College", tableColumn, null);
            //return 0;
            #endregion

            #region SelectData
            //Dictionary<string, object> tableColumn = new Dictionary<string, object>();
            //tableColumn.Add("CollegeID", 9);
            //tableColumn.Add("Name", "环境保护");

            //ConditionList conditionList = new ConditionList(ConditionList.ConditionType.AND);

            //conditionList.Add("CollegeID", ConditionList.EquipType.EQUIP, "1");
            //conditionList.Add("Name", ConditionList.EquipType.EQUIP, "国教院");

            //ConditionList conditionList2 = new ConditionList(ConditionList.ConditionType.OR);

            //conditionList2.Add("CollegeID", ConditionList.EquipType.EQUIP, "2");

            //conditionList2.Add(conditionList);


            //DataSet ds = this.SelectData("College", "CollegeID, Name", conditionList2, null);
            //return 0;
            #endregion

            #region UpdateData
            //Dictionary<string, string> tableColumn = new Dictionary<string, string>();
            //tableColumn.Add("Name", "环境国教院");

            //ConditionList conditionList = new ConditionList(ConditionList.ConditionType.AND);

            //conditionList.Add("CollegeID", ConditionList.EquipType.EQUIP, "1");
            //conditionList.Add("Name", ConditionList.EquipType.EQUIP, "国教院");

            //this.UpdateData("College", tableColumn, conditionList, null);
            //return 0;
            #endregion

            #region DeleteData
            //ConditionList conditionList = new ConditionList(ConditionList.ConditionType.AND);

            //conditionList.Add("CollegeID", ConditionList.EquipType.EQUIP, "9");
            //conditionList.Add("Name", ConditionList.EquipType.EQUIP, "环境保护");

            //this.DeleteData("College", conditionList, null);
            return 0;
            #endregion


            //DbCommand command = GetSqlStringCommand("select * from tb_user");

            //DataSet ds = ExecuteDataSet(command);


            //TBUserModel model = new TBUserModel();

            //Dictionary<string, object> a = new Dictionary<string,object> ();
            //a.Add("password", model.password);
        }
    }
}